﻿using Microsoft.EntityFrameworkCore;


namespace ManageData
{

    public class BasicDbContext : DbContext
    {
        public DbSet<BasicEntity> BasicEntities => Set<BasicEntity>();
        public DbSet<MainEntity> MainEntities => Set<MainEntity>();
        public DbSet<SubEntity> SubEntities => Set<SubEntity>();

        public BasicDbContext() { }
        public BasicDbContext(DbContextOptions options) : base(options) { }
        public BasicDbContext(DbContextOptions<BasicDbContext> options) : base(options) { }
        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);
            optionsBuilder.UseSqlServer("");

            // 注册保存拦截器
            //optionsBuilder.AddInterceptors(new MySaveChangesInterceptor());
        }

    }
}
